//
//  GZRootController.m
//  GongZheng
//
//  Created by huan on 2018/4/26.
//  Copyright © 2018年 huan. All rights reserved.
//

#import "GZRootController.h"
#import "GZHomeController.h"
#import "GZMineController.h"

@interface GZRootController ()

@end

@implementation GZRootController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    GZHomeController *homeVc = [[GZHomeController alloc] init];
    [self addChildViewController:homeVc withTitle:@"首页" normalImage:[UIImage imageNamed:@""] selectImage:[UIImage imageNamed:@""]];
    
    GZMineController *mineVc = [[GZMineController alloc] init];
    [self addChildViewController:mineVc withTitle:@"我的" normalImage:[UIImage imageNamed:@""] selectImage:[UIImage imageNamed:@""]];
    
    self.tabBar.tintColor = [UIColor redColor];
}

- (void)addChildViewController:(UIViewController *)childController withTitle:(NSString *)title normalImage:(UIImage *)norImg selectImage:(UIImage *)selectImg {
    GZNavigationController *nav = [[GZNavigationController alloc] initWithRootViewController:childController];
    nav.tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:[norImg imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[selectImg imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [self addChildViewController:nav];
}



@end
